package com.example.index.controller;

//import com.example.index.dao.EnvironmentDao;
import com.example.index.entity.*;
import com.example.index.service.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class ClubActivitiesController {

//    /**
//     * 服务对象
//     */
//    @Resource
//    private ClubActivitiesService clubActivitiesService;
//    @Resource
//    private LifeService lifeService;
//    @Resource
//    private EnvironmentService environmentService;
//    @Resource
//    private SchoolEnvironmentService schoolEnvironmentService;
//    @Resource
//    private RealityService realityService;
//
//    @GetMapping("schoolImages")
//    public String schoolImages(ModelMap modelMap) {
//        Page<ClubActivities> clubActivities = clubActivitiesService.queryByPage(new ClubActivities(), PageRequest.of(0, 1000));
//        List<ClubActivities> schoolImagesList = clubActivities.getContent();
//        System.out.println(schoolImagesList);
//
//        Page<Life> lives = lifeService.queryByPage(new Life(), PageRequest.of(0, 1000));
//        List<Life> lifeList = lives.getContent();
//        System.out.println(lifeList);
//        modelMap.addAttribute("lifeList",lifeList);
//        modelMap.addAttribute("schoolImagesList",schoolImagesList);
//
//
//        Page<Environment> environments= environmentService.queryByPage(new Environment(), PageRequest.of(0, 1000));
//        List<Environment> cnnList = environments.getContent();
//        System.out.println(cnnList);
//        modelMap.addAttribute("cnnList",cnnList);
//
//        Page<SchoolEnvironment> schoolEnvironments= schoolEnvironmentService.queryByPage(new SchoolEnvironment(), PageRequest.of(0, 1000));
//        List<SchoolEnvironment> schoolEnvironmentsList = schoolEnvironments.getContent();
//        System.out.println(schoolEnvironmentsList);
//        modelMap.addAttribute("schoolEnvironmentsList",schoolEnvironmentsList);
//
//        Page<Reality> realities= realityService.queryByPage(new Reality(), PageRequest.of(0, 1000));
//        List<Reality> realityList = realities.getContent();
//        System.out.println(realityList);
//        modelMap.addAttribute("realityList",realityList);
//
//        return "schoolImages";
//    }
}
